﻿#region License statement
// NJamb, a specification and delta-specification DSL
// Copyright (c) 2010-2011, Mark Knell
// Published under the MIT License; all other rights reserved
#endregion

#region using...
using NUnit.Framework;
using Stile.Testing.SampleTypes;
#endregion

namespace NJamb.NUnit.Tests
{
	[TestFixture]
	public class SampleExperimentFixture : ExperimentOn<Sample>
	{
		[Test]
		public void Exercise()
		{
			// arrange
			Expecting(ThatTheSequence(x => x.IntEnumerable).Is.Empty.AndLater.Has.CountOf(1));

			// act and assert
			Try(x => x.AddToEnumerable(4));
		}

		[Test]
		public void ProvideOwnTestSubject()
		{
			// arrange
			TestSubject = new Sample(-1) {String = string.Empty};
			Expecting(That(x => x.Int).Is.Not.EqualTo(0).AndLater.Is.EqualTo(0));

			// act
			Try(x => x.Int = 0);

			// assert
			AndVerify(() => Assert.That(TestSubject.IntCollection, Is.Empty));
		}

		protected override Sample TestSubjectFactory()
		{
			return new Sample();
		}
	}
}
